<li>
  <p>
    {% if change.method == "remove_one" %}

      {{ _('Removed tag {tag_link} from {pkg_link}').format(
            tag_link = '<a href="{tag_url}">{tag}</a>'.format(
              tag_url = h.url_for(controller='dataset', action='search') +
              "?tags=" + change.tag,
              tag = change.tag
            )|safe,
            pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
              pkg_url = h.url_for(controller='dataset',
                                  action='read', id=change.pkg_id),
              pkg_name = change.title
            )|safe
      ) }}

    {% elif change.method == "remove_multiple" %}

      {{ _('Removed the following tags from {pkg_link}').format(
            pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
              pkg_url = h.url_for(controller='dataset',
                                  action='read', id=change.pkg_id),
              pkg_name = change.title
            )|safe
      )|safe }}

      <ul>
        {% for item in change.tags %}
          <li>
            {{ _('{tag_link}').format(
              tag_link = '<a href="{tag_url}">{tag}</a>'.format(
                tag_url = h.url_for(controller='dataset', action='search') +
                "?tags=" + item,
                tag = item
              )|safe
            )}}
          </li>
        {% endfor %}
      </ul>

    {% elif change.method == "add_one" %}

      {{ _('Added tag {tag_link} to {pkg_link}').format(
          tag_link = '<a href="{tag_url}">{tag}</a>'.format(
            tag_url = h.url_for(controller='dataset', action='search') +
            "?tags=" + change.tag,
            tag = change.tag
          )|safe,
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe
      ) }}

    {% elif change.method == "add_multiple" %}

      {{ _('Added the following tags to {pkg_link}').format(
        pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
          pkg_url = h.url_for(controller='dataset',
                              action='read', id=change.pkg_id),
          pkg_name = change.title
        )|safe
      ) }}
      <ul>
        {% for item in change.tags %}
          <li>
            {# TODO: figure out which controller to actually use here #}
            {{ _('{tag_link}').format(
              tag_link = '<a href="{tag_url}">{tag}</a>'.format(
                tag_url = h.url_for(controller='dataset', action='search') +
                "?tags=" + item,
                tag = item
              )|safe
            )}}
          </li>
        {% endfor %}
      </ul>

    {% else %}

      {{ _('No fields were updated. See the metadata diff for more details.') }}

    {% endif %}
  </p>
</li>
